package com.ruoyi.api.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.api.mapper.ProjectApiMapper;
import com.ruoyi.api.domain.ProjectApi;
import com.ruoyi.api.service.IProjectApiService;

/**
 * 接口管理Service业务层处理
 * 
 * @author yhg
 * @date 2022-10-21
 */
@Service
public class ProjectApiServiceImpl implements IProjectApiService 
{
    @Autowired
    private ProjectApiMapper projectApiMapper;

    /**
     * 查询接口管理
     * 
     * @param id 接口管理主键
     * @return 接口管理
     */
    @Override
    public ProjectApi selectProjectApiById(Long id)
    {
        return projectApiMapper.selectProjectApiById(id);
    }

    /**
     * 查询接口管理列表
     * 
     * @param projectApi 接口管理
     * @return 接口管理
     */
    @Override
    public List<ProjectApi> selectProjectApiList(ProjectApi projectApi)
    {
        return projectApiMapper.selectProjectApiList(projectApi);
    }

    /**
     * 新增接口管理
     * 
     * @param projectApi 接口管理
     * @return 结果
     */
    @Override
    public int insertProjectApi(ProjectApi projectApi)
    {
        projectApi.setCreateTime(DateUtils.getNowDate());
        return projectApiMapper.insertProjectApi(projectApi);
    }

    /**
     * 修改接口管理
     * 
     * @param projectApi 接口管理
     * @return 结果
     */
    @Override
    public int updateProjectApi(ProjectApi projectApi)
    {
        projectApi.setUpdateTime(DateUtils.getNowDate());
        return projectApiMapper.updateProjectApi(projectApi);
    }

    /**
     * 批量删除接口管理
     * 
     * @param ids 需要删除的接口管理主键
     * @return 结果
     */
    @Override
    public int deleteProjectApiByIds(Long[] ids)
    {
        return projectApiMapper.deleteProjectApiByIds(ids);
    }

    /**
     * 删除接口管理信息
     * 
     * @param id 接口管理主键
     * @return 结果
     */
    @Override
    public int deleteProjectApiById(Long id)
    {
        return projectApiMapper.deleteProjectApiById(id);
    }
}
